package tech.powerjob.official.processors.impl.script;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * python processor
 *
 * @author tjq
 * @since 2021/2/7
 */
public class PythonProcessor extends AbstractScriptProcessor {

    @Override
    protected String getScriptProcessorName() {
        return PYTHON_PROCESSOR;
    }

    @Override
    protected String getScriptName(Long instanceId) {
        return String.format("python_%d.py", instanceId);
    }

    @Override
    protected List<String> getRunCommand() {
        // return new ArrayList<>(Arrays.asList("python", "-u"));
        return new ArrayList<>(Arrays.asList(SH_SHELL, "-c", "\"python %s > /dev/null 2>&1\"")); // , "&"
    }
}
